import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import "../../i18n/zhongying";
import { Button } from "antd";
function Index() {
  const { t, i18n } = useTranslation();
  const change = () => {
    i18n.changeLanguage(i18n.language === "zh" ? "en" : "zh");
  };
  const [count, setCount] = useState(0);

  const increment = () => {
    setCount((accdd) => accdd + 1);
  };

  const decrement = () => {
    setCount((accdd) => accdd - 1);
  };
  return (
    <div>
      <h1>{t("hellow")}</h1>
      <Button onClick={change}>{i18n.language === "zh" ? "中" : "英"}</Button>

      {/* 加减 */}
      <button onClick={decrement}>-----</button>

      <span style={{ fontSize: "18px", minWidth: "30px", textAlign: "center" }}>
        {count}
      </span>

      <button onClick={increment}>++++</button>
      <h1>i发动快女不会v十分可观的你</h1>
    </div>
  );
}

export default Index;
